package com.cy.model;

import com.cy.BasicModel;
import com.cy.ext.plugin.tablebind.TableBind;

import java.util.Date;

/**
 * 用户历史信息
 */
@TableBind(tableName="user_info_history")
public class UserInfoHistory extends BasicModel<UserInfoHistory> {
    public static final UserInfoHistory dao = new UserInfoHistory();
    public static final String SELECT_ALL = "`id`,`user_id`,`app_version_id`,`ip`,`create_time`,`mobile_phone_model`,`operating_system`,`operating_system_version`,`remark`";

    public UserInfoHistory findLastByUser(Long userId) {
        return findFirst("select " + SELECT_ALL + " from user_info_history where user_id = ? order by create_time desc limit 1", userId);
    }

    public UserInfoHistory setId(Long id){
        return this.set("id",id);
    }

    public Long getId(){
        return this.get("id");
    }
            
    public UserInfoHistory setUserId(Long userId){
        return this.set("user_id",userId);
    }

    public Long getUserId(){
        return this.get("user_id");
    }
        
    public UserInfoHistory setAppVersionId(Long appVersionId){
        return this.set("app_version_id",appVersionId);
    }

    public Long getAppVersionId(){
        return this.get("app_version_id");
    }
        
    public UserInfoHistory setIp(String ip){
        return this.set("ip",ip);
    }

    public String getIp(){
        return this.getStr("ip");
    }
        
    public UserInfoHistory setCreateTime(Date createTime){
        return this.set("create_time",createTime);
    }

    public Date getCreateTime(){
        return this.getDate("create_time");
    }
    public UserInfoHistory setMobilePhoneModel(String mobilePhoneModel){
        return this.set("mobile_phone_model",mobilePhoneModel);
    }

    public String getMobilePhoneModel(){
        return this.getStr("mobile_phone_model");
    }

    public UserInfoHistory setOperatingSystem(String operatingSystem){
        return this.set("operating_system",operatingSystem);
    }

    public String getOperatingSystem(){
        return this.getStr("operating_system");
    }

    public UserInfoHistory setOperatingSystemVersion(String operatingSystemVersion){
        return this.set("operating_system_version",operatingSystemVersion);
    }

    public String getOperatingSystemVersion(){
        return this.getStr("operating_system_version");
    }

    public UserInfoHistory setRemark(String remark){
        return this.set("remark",remark);
    }

    public String getRemark(){
        return this.getStr("remark");
    }

}